/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.sun.dtv.resources;

/**
 *
 * @author stupied
 */
public interface ScarceResourceListener {

    /**
     * Reports that resource is being requested by another application.
     *
     * @param resource The instance of the scarce resource that is requested to be released.
     * @return A boolean indicating whether the current application and the owner no longer needs the resource.
     */
    boolean releaseRequested(ScarceResource resource);
    
    /**
     * Reports that resource is being aggressively requested by another application and gives the current owner the chance to close his task.
     *
     * @param resource The instance of the scarce resource that is required to be released.
     */
    void releaseForced(ScarceResource resource);

    /**
     * Reports that resource has been released by the implementation and is available for a new reservation.
     *
     * @param resource The instance of the scarce resource that has been released.
     */
    void released(ScarceResource resource);

}
